import os

import openpyxl

import Frame


class Test(Frame.Ui_Form):
    def __init__(self):
        super().__init__()

    def setEvent(self):
        self.selectTZBtn.clicked.connect(self.on_selectTZBtn_clicked)

    def on_selectTZBtn_clicked(self):
        print("点击了选择台账按钮")


if __name__ == '__main__':
    from openpyxl.worksheet.worksheet import Worksheet
    file_path = 'E:\Projects\PyCharmProject\Excel-Reflection-Software\dist\测试数据\GL水泥混凝土抗压报告、记录表.xlsx'
    wb = openpyxl.open(file_path)
    # names =

    sheet: Worksheet = wb[wb.sheetnames[0]]
    print(wb.sheetnames)
    sheet["B1"] = "测试"
    sheet["A1"] = "测试"

    path = os.path.expanduser('~') + "\\Desktop\\result"
    wb.close()
    wb.save(path+"\\result.xlsx")

